import { Pagination } from 'antd';
import { FC } from 'react'
import { IParameterar } from '../../types'

interface IProps {
    filelist: IParameterar,
    getFiles(pageNo: number, pageSize?: number): void
}

const Paging: FC<IProps> = ({
    filelist,
    getFiles
}) => {

    const pagingChang = (page: number, pageSize: number | undefined): void => {
        getFiles(page, pageSize)
    }

    return (
        <div className="paging">
            <Pagination onChange={pagingChang} showTotal={total => `共 ${total} 个`} defaultCurrent={1} defaultPageSize={10} total={filelist.total} />
        </div>
    )
}

export default Paging